.root {}

.label {
    display: inline-block;
    padding-right: 5px;
}

.label[required]:after {
    content: '*';
    color: red;
}

.field {
    display: inline-block;
    position: relative;
}

.message {
    margin-left: 5px;
    padding: 0 5px;
    background: $background-color-base;
}

.message[color="error"] {
    background: $brand-error;
    color: white;
}

.root[placement="bottom"] .message {
    position: absolute;
    top: 100%;
    left: 0;
    margin-left: 0;
}

.root[label-size$="normal"] .label { width: 80px; }
.root[label-size$="normal"] .field { max-width: calc(100% - 80px); }

.root[layout="block"] .field {
    vertical-align: top;
}

.label {
    color: #999;
    text-align: right;
    padding-right: 10px;
    position: relative;
}

.label[required]:after {
    content: '*';
    color: $brand-error;
    position: absolute;
    right: 2px;
    height: 12px;
    line-height: 12px;
    top: 7px;
}

.message {
    position: absolute;
    left: 100%;
    top: 0;
    display: none;
    margin-left: 10px;
    padding: 0 10px;
    line-height: 26px;
    font-size: 12px;
}


.message[color="focus"] {
    display: block;
    padding: 3px 10px;
    height: auto;
    width: 300px;
    background: #f7faff;
    color: #7dacde;
    border: 1px solid #d6e6fe;
}

.message[color="focus"]:after, .message[color="focus"]:before {
    position: absolute;
    content: '';
    top: 10px;
    left: -8px;
    border: 4px solid transparent;
    border-right: 4px solid #f7faff;
}

.message[color="focus"]:before {
    border-right-color: #d6e6fe;
    left: -9px;
}

.message[color="error"] {
    display: block;
    margin: 3px 10px;
    white-space: nowrap;
    background-color: #ff867f;
    color: #fff;
}

.message[color="error"]:after {
    content: '';
    position: absolute;
    right: 100%;
    top: 8px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-right: 4px solid #ff867f;
    border-bottom: 4px solid transparent;
}

.root[placement="bottom"] .message:after {
    display: none;
}

.root[label-size$="small"] .label { width: 80px; padding-right: 10px; }
.root[label-size$="small"] .label:after{ right: 2px; }
.root[label-size$="small"] .field { max-width: calc(100% - 80px); }
.root[label-size$="normal"] .label { width: 120px; padding-right: 20px; }
.root[label-size$="normal"] .label:after { right: 12px; }
.root[label-size$="normal"] .field { max-width: calc(100% - 120px); }
.root[label-size$="large"] .label { width: 160px; padding-right: 20px; }
.root[label-size$="large"] .label:after{ right: 12px; }
.root[label-size$="large"] .field { max-width: calc(100% - 160px); }

.description {
    color: #999;
    margin-bottom: 10px;
}

.description:empty {
    display: none;
}
